import { App } from "vue";
import { useUserStore } from '@/store/user'

export const regPermission = (app: App<Element>) => {
    app.directive('permission', {
        mounted(el, binding) {
            const store = useUserStore()
            if (!store.permissions.includes(binding.value)) {
                el.remove()
            }
        }
    })
}